Skip to content

fix: resolve typecheck failures with proper Effect tagged errors - #147

Merged
RhysSullivan merged 1 commit into
mainfrom
fix/typecheck-effect-tagged-errors
Apr 10, 2026
Merged

fix: resolve typecheck failures with proper Effect tagged errors#147
RhysSullivan merged 1 commit into
mainfrom
fix/typecheck-effect-tagged-errors

Conversation

@RhysSullivan

Copy link
Copy Markdown
Collaborator

Summary

  • Replace all @effect/language-service diagnostic suppressions (globalErrorInEffectCatch, globalErrorInEffectFailure, unknownInEffectCatch) with properly typed tagged errors across the monorepo
  • Add PromiseAdapterError + fromPromiseTagged helper in promise-executor.ts that runtime-checks rejection _tag fields against an allow-list, re-raising matches as typed failures and dying on unexpected errors
  • Replace all as ToolId / as SecretId / as ScopeIdType / as PolicyId casts with Brand.make() calls
  • Split PausedExecution into a public type (id + elicitationContext) and an internal type (+ Deferred/Fiber/Ref) so consumers don't depend on Effect runtime internals
  • Clean up server.test.ts: extract withClient, textOf, makePausedResult, makeElicitingEngine helpers; eliminate all try/finally boilerplate and as any casts

Test plan

  • turbo run typecheck passes 27/27 packages with zero warnings
  • vitest run passes for @executor/host-mcp (23 tests)
  • Rebased on latest main

Replace all @effect/language-service diagnostic suppressions with
proper tagged error types. Remove every `globalErrorInEffectCatch`,
`globalErrorInEffectFailure`, and `unknownInEffectCatch` disable
across all tsconfigs.

- Add PromiseAdapterError + fromPromiseTagged helper in promise-executor
  for typed Promise→Effect error bridging with runtime _tag checking
- Replace `as ToolId` / `as SecretId` etc. casts with Brand.make() calls
- Add ServiceAdapterError + tryPromiseService in cloud auth layer
- Replace `Effect.fail(new Error(...))` with OrganizationNotFoundError
- Split PausedExecution into public (id + context) and internal
  (+ Deferred/Fiber/Ref) types so consumers don't see Effect internals
- Fix resume handler to discriminate completed vs paused results
- Clean up server.test.ts: extract withClient, textOf, makePausedResult,
  makeElicitingEngine helpers; remove all try/finally boilerplate
- Remove unused imports in tool-invoker.test.ts
@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Apr 10, 2026

Copy link
Copy Markdown

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Updated (UTC)
✅ Deployment successful!
View logs
executor-cloud b25ca0d Apr 10 2026, 04:50 AM

@RhysSullivan
RhysSullivan merged commit fe663a3 into main Apr 10, 2026
2 checks passed
RhysSullivan added a commit that referenced this pull request May 31, 2026
Replace all @effect/language-service diagnostic suppressions with
proper tagged error types. Remove every `globalErrorInEffectCatch`,
`globalErrorInEffectFailure`, and `unknownInEffectCatch` disable
across all tsconfigs.

- Add PromiseAdapterError + fromPromiseTagged helper in promise-executor
  for typed Promise→Effect error bridging with runtime _tag checking
- Replace `as ToolId` / `as SecretId` etc. casts with Brand.make() calls
- Add ServiceAdapterError + tryPromiseService in cloud auth layer
- Replace `Effect.fail(new Error(...))` with OrganizationNotFoundError
- Split PausedExecution into public (id + context) and internal
  (+ Deferred/Fiber/Ref) types so consumers don't see Effect internals
- Fix resume handler to discriminate completed vs paused results
- Clean up server.test.ts: extract withClient, textOf, makePausedResult,
  makeElicitingEngine helpers; remove all try/finally boilerplate
- Remove unused imports in tool-invoker.test.ts
@RhysSullivan
RhysSullivan deleted the fix/typecheck-effect-tagged-errors branch June 11, 2026 08:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant